package com.hrt.manage.stock.service;

import java.sql.Timestamp;
import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.hrt.bean.OrderInfor;
import com.hrt.bean.StockDetail;
import com.hrt.bean.Stocks;
import com.hrt.vo.StockDetailVO;
import com.hrt.vo.StocksVO;

public interface StocksService {

	public List<Stocks> getStockByType(Integer reType, Long proId);

	public List<Stocks> getStockByType(Long proId, Integer reType,
			Integer pageIndex, Integer pageSize);

	public List<Stocks> getProductByReType(Integer retype, Integer pageIndex,
			Integer pageSize);

	public List<Stocks> getProductByAction(Integer actStr, Integer pageIndex,
			Integer pageSize);

	public List<Stocks> getStockList(Integer retype, Integer actStr,
			Integer pageIndex, Integer pageSize);

	public Long totalCount(Integer reType);

	@Transactional
	public Stocks saveStocks(StocksVO stocks);
	
	@Transactional
	public boolean updateStock(StocksVO stocks);
	

	public Timestamp getDate();

	@Transactional
	public void saveDetail(Stocks newBean,List<StockDetail> detailsList);
	
	@Transactional
	public void updateDetail(Stocks newBean, List<StockDetail> detailsList);

	
	public StocksVO getStockById(Long id);

	@Transactional
	public void deleteById(Long[] idArr);

	public List<StockDetailVO> getDetialsByStockId(Long stockId);

	
	/**
	 * 订单转换成出库单对象
	 * @param order
	 * @return
	 */
	public StocksVO transOrderToStock(OrderInfor order);

	
	/**
	 * 订单转换成出库单对象,并出库
	 * @param order
	 * @return
	 */
	@Transactional
	public Stocks outStockByOrder(OrderInfor order);

	/**
	 * 由订单转换成退货单
	 * @param order
	 * @return
	 */
	@Transactional
	public Stocks backStockByOrder(OrderInfor order);
	

	
	
	
	

}
